#ifndef BASETASKS_H
#define BASETASKS_H
#include "StompedReality/Core.h"
#include "StompedReality/Core/Task/Task.h"
#include "StompedReality/Core/TypeSystem/TypeSystem.h"

StaticRegDummy( Task );

namespace StompedReality
{

class IGame;

namespace Core
{

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Update game time task.
 *
 *			Updates the game time.
 */
struct DLL_EXPORT UpdateGameTimeTask : public Task
{
  //! \brief	Constructor.
  UpdateGameTimeTask( ) {
  }

  //! \brief	Destructor.
  ~UpdateGameTimeTask( ) {
  }

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( ) {
  };
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Start rendering task.
 *
 *			Calls BeginRendering of the games render system.
 */
struct DLL_EXPORT BeginRenderTask : public Task
{
  //! \brief	Constructor.
  BeginRenderTask( ) {
  }

  //! \brief	Destructor.
  ~BeginRenderTask( ) {
  }

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( ) {
  };
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	End rendering task.
 *
 *			Calls EndRendering of the games render system.
 */
struct DLL_EXPORT EndRenderTask : public Task
{
  //! \brief	Constructor.
  EndRenderTask( ) {
  }

  //! \brief	Destructor.
  ~EndRenderTask( ) {
  }

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( ) {
  };
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Swaps buffer.
 *
 *			Calls SwapBuffer of the games render system.
 */
struct DLL_EXPORT SwapBufferRenderTask : public Task
{
  //! \brief	Constructor.
  SwapBufferRenderTask( ) {
  }

  //! \brief	Destructor.
  ~SwapBufferRenderTask( ) {
  }

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( ) {
  };
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Update Input.
 *
 *			Updates mouse and keyboard input
 */
struct DLL_EXPORT UpdateInputTask : public Task
{
  //! \brief Constructor.
  UpdateInputTask( ) {
  }

  //! \brief	Destructor.
  ~UpdateInputTask( ) {
  }

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( ) {
  };
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Draws components of given type.
 *
 *			Draws all compnents of the given type.
 */
struct DLL_EXPORT DrawComponentTask : public Task
{
  //! \brief Constructor
  DrawComponentTask( ) {
  }

  //! \brief	Destructor.
  ~DrawComponentTask( ) {
  }

  //! \brief	Types name.
  //!			The value is read from the corresponding json (Field: component).
  std::string TypeName;

  //! \brief	Types id.
  //!			Created from TypeName by Initialize
  StompedReality::TYPE_ID TypeID;

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( );
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Updates components of given type.
 *
 *			Updates all compnents of the given type.
 */
struct DLL_EXPORT UpdateComponentTask : public Task
{
  //! \brief Constructor
  UpdateComponentTask( ) {
  }

  //! \brief	Destructor.
  ~UpdateComponentTask( ) {
  }

  //! \brief	Types name.
  //!			The value is read from the corresponding json (Field: component).
  std::string TypeName;

  //! \brief	Types id.
  //!			Created from TypeName by Initialize
  StompedReality::TYPE_ID TypeID;

  //! \brief	Execute task.
  //! \param	game	The game.
  void Exectue( StompedReality::IGame* game );

  //! \brief	Initializer.
  //!			Initializes the task
  void Initialize ( );
};

}
}
#endif // BASETASKS_H
